﻿//==================================================================
// Copyright (C) 2011 深圳市中旭企业管理股份有限公司
// 文件名: CrmCustomerOrder.cs
// 作 者：代码自动生成
// 日 期：2012-1-11 15:45:41
// 描 述：
// 版 本：1.00
// 修改历史纪录
// 版 本  修改时间      修改人            修改内容
// 1.00             
//==================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.Text;
using Csla;
using lite;
using Csla.Validation;
using Csla.Data;
using System.Data.SqlClient;
using ZX.DAL;
using OpenExpressApp.ORM;

namespace ZX.CRM.Library
{
	/// <summary>
    /// 
    /// </summary>
	[Serializable]
    [Table(Name="CrmCustomerOrder")]
    [ZX.DBModule.Table("CrmCustomerOrder","ID")]
	public class CrmCustomerOrder: ZX.DBModule.BaseEntity
	{
        
        #region Business Methods 业务方法
       
		/// <summary>
        /// ID
        /// </summary>
        private static PropertyInfo< Guid > IDProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< Guid >("ID"));
        [DataObjectField(true, true)]
        [Column, PK]
        public Guid ID
        {
            get { return GetProperty(IDProperty); }
            set { SetProperty(IDProperty, value); }
        }
        
		/// <summary>
        /// 订单编码
        /// </summary>
        private static PropertyInfo< string > CodeProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< string >("Code"));
        [Column]
        public string Code
        {
            get { return GetProperty(CodeProperty); }
            set { SetProperty(CodeProperty, value); }
        }
		/// <summary>
        /// 客户ID
        /// </summary>
        private static PropertyInfo< Guid > CustomerIdProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< Guid >("CustomerId"));
        [Column]
        public Guid CustomerId
        {
            get { return GetProperty(CustomerIdProperty); }
            set { SetProperty(CustomerIdProperty, value); }
        }
		/// <summary>
        /// 业绩归属()
        /// </summary>
        private static PropertyInfo< Guid > DeptIdProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< Guid >("DeptId"));
        [Column]
        public Guid DeptId
        {
            get { return GetProperty(DeptIdProperty); }
            set { SetProperty(DeptIdProperty, value); }
        }
		/// <summary>
        /// 订单日期
        /// </summary>
        private static PropertyInfo< DateTime > DateProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< DateTime >("Date"));
        [Column]
        public DateTime Date
        {
            get { return GetProperty(DateProperty); }
            set { SetProperty(DateProperty, value); }
        }
		/// <summary>
        /// 订单类型
        /// </summary>
        private static PropertyInfo< Guid > TypeIDProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< Guid >("TypeID"));
        [Column]
        public Guid TypeID
        {
            get { return GetProperty(TypeIDProperty); }
            set { SetProperty(TypeIDProperty, value); }
        }
		/// <summary>
        /// 币别ID
        /// </summary>
        private static PropertyInfo< Guid > ValutaIDProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< Guid >("ValutaID"));
        [Column]
        public Guid ValutaID
        {
            get { return GetProperty(ValutaIDProperty); }
            set { SetProperty(ValutaIDProperty, value); }
        }
		/// <summary>
        /// 汇率ID
        /// </summary>
        private static PropertyInfo< Guid > PillIDProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< Guid >("PillID"));
        [Column]
        public Guid PillID
        {
            get { return GetProperty(PillIDProperty); }
            set { SetProperty(PillIDProperty, value); }
        }
		/// <summary>
        /// 课程规划ID
        /// </summary>
        private static PropertyInfo< Guid > CourseLoyoutIDProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< Guid >("CourseLoyoutID"));
        [Column]
        public Guid CourseLoyoutID
        {
            get { return GetProperty(CourseLoyoutIDProperty); }
            set { SetProperty(CourseLoyoutIDProperty, value); }
        }
		/// <summary>
        /// 已收金额
        /// </summary>
        private static PropertyInfo< decimal > ResignMoneyProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< decimal >("ResignMoney"));
        [Column]
        public decimal ResignMoney
        {
            get { return GetProperty(ResignMoneyProperty); }
            set { SetProperty(ResignMoneyProperty, value); }
        }
		/// <summary>
        /// 总额
        /// </summary>
        private static PropertyInfo< decimal > TotalMoneyProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< decimal >("TotalMoney"));
        [Column]
        public decimal TotalMoney
        {
            get { return GetProperty(TotalMoneyProperty); }
            set { SetProperty(TotalMoneyProperty, value); }
        }
		/// <summary>
        /// 付款方式ID
        /// </summary>
        private static PropertyInfo< Guid > PaymentIdProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< Guid >("PaymentId"));
        [Column]
        public Guid PaymentId
        {
            get { return GetProperty(PaymentIdProperty); }
            set { SetProperty(PaymentIdProperty, value); }
        }
		/// <summary>
        /// 订单状态ID
        /// </summary>
        private static PropertyInfo<Guid> StateIDProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<Guid>("StateID"));
        [Column]
        public Guid StateID
        {
            get { return GetProperty(StateIDProperty); }
            set { SetProperty(StateIDProperty, value); }
        }
		/// <summary>
        /// 说明
        /// </summary>
        private static PropertyInfo< string > ExplainProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< string >("Explain"));
        [Column]
        public string Explain
        {
            get { return GetProperty(ExplainProperty); }
            set { SetProperty(ExplainProperty, value); }
        }
		/// <summary>
        /// 操作员编号
        /// </summary>
        private static PropertyInfo< Guid > AddUserProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< Guid >("AddUser"));
        [Column]
        public Guid AddUser
        {
            get { return GetProperty(AddUserProperty); }
            set { SetProperty(AddUserProperty, value); }
        }
		/// <summary>
        /// 新增时间
        /// </summary>
        private static PropertyInfo< DateTime > AddTimeProperty = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< DateTime >("AddTime"));
        [Column]
        public DateTime AddTime
        {
            get { return GetProperty(AddTimeProperty); }
            set { SetProperty(AddTimeProperty, value); }
        }
        /// <summary>
        /// 产品包ID
        /// </summary>
        private static PropertyInfo<Guid> ProductPackIDProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<Guid>("ProductPackID"));
        [Column]
        public Guid ProductPackID
        {
            get { return GetProperty(ProductPackIDProperty); }
            set { SetProperty(ProductPackIDProperty, value); }
        }
        /// <summary>
        /// 是否价值业绩
        /// </summary>
        private static PropertyInfo<string> IsPerformanceProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("IsPerformance"));
        [Column]
        public string IsPerformance
        {
            get { return GetProperty(IsPerformanceProperty); }
            set { SetProperty(IsPerformanceProperty, value); }
        }
        /// <summary>
        /// 是否历史数据
        /// </summary>
        private static PropertyInfo<string> IsHistoryProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("IsHistory"));
        [Column]
        public string IsHistory
        {
            get { return GetProperty(IsHistoryProperty); }
            set { SetProperty(IsHistoryProperty, value); }
        }

		/// <summary>
        /// 备用1
        /// </summary>
        private static PropertyInfo< string > EXP1Property = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< string >("EXP1"));
        [Column]
        public string EXP1
        {
            get { return GetProperty(EXP1Property); }
            set { SetProperty(EXP1Property, value); }
        }
		/// <summary>
        /// 备用2
        /// </summary>
        private static PropertyInfo< string > EXP2Property = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< string >("EXP2"));
        [Column]
        public string EXP2
        {
            get { return GetProperty(EXP2Property); }
            set { SetProperty(EXP2Property, value); }
        }
		/// <summary>
        /// 备用3
        /// </summary>
        private static PropertyInfo< string > EXP3Property = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< string >("EXP3"));
        [Column]
        public string EXP3
        {
            get { return GetProperty(EXP3Property); }
            set { SetProperty(EXP3Property, value); }
        }
		/// <summary>
        /// 备用4
        /// </summary>
        private static PropertyInfo< string > EXP4Property = RegisterProperty(typeof(CrmCustomerOrder),new PropertyInfo< string >("EXP4"));
        [Column]
        public string EXP4
        {
            get { return GetProperty(EXP4Property); }
            set { SetProperty(EXP4Property, value); }
        }


        /// <summary>
        /// 列表
        /// </summary>
        private static PropertyInfo<string> ProduectListProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("ProduectList"));
        public string ProduectList
        {
            get { return GetProperty(ProduectListProperty); }
            set { SetProperty(ProduectListProperty, value); }
        }
        /// <summary>
        /// 列表
        /// </summary>
        private static PropertyInfo<string> NewProduectListProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("NewProduectList"));
        public string NewProduectList
        {
            get { return GetProperty(NewProduectListProperty); }
            set { SetProperty(NewProduectListProperty, value); }
        }
        /// <summary>
        /// 客户总监列表
        /// </summary>
        private static PropertyInfo<string> CustomerZjListProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("CustomerZjList"));
        public string CustomerZjList
        {
            get { return GetProperty(CustomerZjListProperty); }
            set { SetProperty(CustomerZjListProperty, value); }
        }
        /// <summary>
        /// 列表
        /// </summary>
        private static PropertyInfo<string> CustomerServerListProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("CustomerServerList"));
        public string CustomerServerList
        {
            get { return GetProperty(CustomerServerListProperty); }
            set { SetProperty(CustomerServerListProperty, value); }
        }


        /// <summary>
        /// 讲师ID
        /// </summary>
        private static PropertyInfo<Guid> TeacherIdProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<Guid>("TeacherId"));
        public Guid TeacherId
        {
            get { return GetProperty(TeacherIdProperty); }
            set { SetProperty(TeacherIdProperty, value); }
        }
        /// <summary>
        /// 讲场时间
        /// </summary>
        private static PropertyInfo<DateTime> TeacherTimeProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<DateTime>("TeacherTime"));
        public DateTime TeacherTime
        {
            get { return GetProperty(TeacherTimeProperty); }
            set { SetProperty(TeacherTimeProperty, value); }
        }
        /// <summary>
        /// 讲场地点
        /// </summary>
        private static PropertyInfo<string> TeacherAddressProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("TeacherAddress"));
        public string TeacherAddress
        {
            get { return GetProperty(TeacherAddressProperty); }
            set { SetProperty(TeacherAddressProperty, value); }
        }
        /// <summary>
        /// 讲场类型
        /// </summary>
        private static PropertyInfo<string> TeacherTypeProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("TeacherType"));
        public string TeacherType
        {
            get { return GetProperty(TeacherTypeProperty); }
            set { SetProperty(TeacherTypeProperty, value); }
        }
        /// <summary>
        /// 接洽人ID
        /// </summary>
        private static PropertyInfo<Guid> LinkManIdProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<Guid>("LinkManId"));
        public Guid LinkManId
        {
            get { return GetProperty(LinkManIdProperty); }
            set { SetProperty(LinkManIdProperty, value); }
        }
        /// <summary>
        /// 接洽人姓名
        /// </summary>
        private static PropertyInfo<string> LinkManNameProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("LinkManName"));
        public string LinkManName
        {
            get { return GetProperty(LinkManNameProperty); }
            set { SetProperty(LinkManNameProperty, value); }
        }
        /// <summary>
        /// 接洽人性别
        /// </summary>
        private static PropertyInfo<string> LinkManSexProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("LinkManSex"));
        public string LinkManSex
        {
            get { return GetProperty(LinkManSexProperty); }
            set { SetProperty(LinkManSexProperty, value); }
        }
        /// <summary>
        /// 接洽人职位
        /// </summary>
        private static PropertyInfo<string> LinkManPositionProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("LinkManPosition"));
        public string LinkManPosition
        {
            get { return GetProperty(LinkManPositionProperty); }
            set { SetProperty(LinkManPositionProperty, value); }
        }
        /// <summary>
        /// 接洽人手机
        /// </summary>
        private static PropertyInfo<string> LinkManTelProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("LinkManTel"));
        public string LinkManTel
        {
            get { return GetProperty(LinkManTelProperty); }
            set { SetProperty(LinkManTelProperty, value); }
        }
        /// <summary>
        /// 助约人
        /// </summary>
        private static PropertyInfo<Guid> ZhuYueRenIDProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<Guid>("ZhuYueRenID"));
        public Guid ZhuYueRenID
        {
            get { return GetProperty(ZhuYueRenIDProperty); }
            set { SetProperty(ZhuYueRenIDProperty, value); }
        }







        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkFlowIdProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("WorkFlowId"));
        [Column]
        public string WorkFlowId
        {
            get { return GetProperty(WorkFlowIdProperty); }
            set { SetProperty(WorkFlowIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkFlowInsIdProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("WorkFlowInsId"));
        [Column]
        public string WorkFlowInsId
        {
            get { return GetProperty(WorkFlowInsIdProperty); }
            set { SetProperty(WorkFlowInsIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkTaskIdProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("WorkTaskId"));
        [Column]
        public string WorkTaskId
        {
            get { return GetProperty(WorkTaskIdProperty); }
            set { SetProperty(WorkTaskIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> WorkTaskInsIdProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("WorkTaskInsId"));
        [Column]
        public string WorkTaskInsId
        {
            get { return GetProperty(WorkTaskInsIdProperty); }
            set { SetProperty(WorkTaskInsIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> CheckUserProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("CheckUser"));
        [Column]
        public string CheckUser
        {
            get { return GetProperty(CheckUserProperty); }
            set { SetProperty(CheckUserProperty, value); }
        }

        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> PresentationTypeProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<Guid>("PresentationType"));
        [Column]
        public Guid PresentationType
        {
            get { return GetProperty(PresentationTypeProperty); }
            set { SetProperty(PresentationTypeProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<Guid> PresentationOrderIdProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<Guid>("PresentationOrderId"));
        [Column]
        public Guid PresentationOrderId
        {
            get { return GetProperty(PresentationOrderIdProperty); }
            set { SetProperty(PresentationOrderIdProperty, value); }
        }
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo<string> PresentationReasonProperty = RegisterProperty(typeof(CrmCustomerOrder), new PropertyInfo<string>("PresentationReason"));
        [Column]
        public string PresentationReason
        {
            get { return GetProperty(PresentationReasonProperty); }
            set { SetProperty(PresentationReasonProperty, value); }
        }
        #endregion
        
        #region Validation Rules 验证规则
        //将验证规则与业务对象的属性联系在一起
        protected override void AddBusinessRules()
        {
            //AddRule的第一个参数是委托变量，也就是说是方法的变量
            ValidationRules.AddRule(CommonRules.StringRequired, "Code");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Code", 15));
            ValidationRules.AddRule(CommonRules.StringRequired, "State");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("State", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "Explain");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Explain", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "EXP1");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("EXP1", 40));
            ValidationRules.AddRule(CommonRules.StringRequired, "EXP2");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("EXP2", 40));
            ValidationRules.AddRule(CommonRules.StringRequired, "EXP3");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("EXP3", 40));
            ValidationRules.AddRule(CommonRules.StringRequired, "EXP4");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("EXP4", 40));
            //base.AddBusinessRules();
        }
        #endregion
        
        #region Factory Methods 工厂方法

        public CrmCustomerOrder(){}

        public static CrmCustomerOrder New()
        {
            return DataPortal.Create< CrmCustomerOrder>();
        }
        public static CrmCustomerOrder Get(Guid ID)
        {
            return DataPortal.Fetch< CrmCustomerOrder>(new SingleLazyCriteria< CrmCustomerOrder, Guid>(ID, false));
        }
        public static void Delete(Guid ID)
        {
            DataPortal.Delete(ID);
        }

        //public override CrmCustomerOrder Save()
        //{
            //return base.Save();
        //}
        #endregion
		
		#region Data Access 数据访问
        //由于DataPortal_create中没有对数据库的访问，所有标记了Runlocal特性，使得该方法只需在本地运行即可
        //如果代码中有访问数据库的方法，那么就不要用这个特性，使数据门户可以根据情况将此方法的运行选择在应用服务器还是本地
        [RunLocal()]
        protected override void DataPortal_Create()
        {
            //在此调用CheckRules对所有的属性进行验证规则的检查，这样检查只运行一次。
            ValidationRules.CheckRules();
        }


        //可以看到此方法没有标记任何特性
        //此方法要访问数据库所以不能标记本地，由于她没有任何数据库更新操作所以也无需事务性的保护
        //此方法调用结束后会隐含的调用MarkOld（）方法
        private void DataPortal_Fetch(Guid ID)
        {
            //通过连接字符串建立SQL连接对象，Using符号代表，范围释放的意思，SqlConnection对象会在此范围后被释放掉
             using (var ctx = ConnectionManager<SqlConnection>.GetManager(ConnectionStringNames))
            {
                IDb db = DbFactory.Instance.GetDb(ctx.Connection);
                IQuery q = db.Query();
                q.Constrain("ID").Equal(ID);
                var data = db.Select< CrmCustomerOrder>(q)[0];
                LoadProperty(IDProperty, data.ID);
                LoadProperty(CodeProperty, data.Code);
                LoadProperty(CustomerIdProperty, data.CustomerId);
                LoadProperty(DeptIdProperty, data.DeptId);
                LoadProperty(DateProperty, data.Date);
                LoadProperty(TypeIDProperty, data.TypeID);
                LoadProperty(ValutaIDProperty, data.ValutaID);
                LoadProperty(PillIDProperty, data.PillID);
                LoadProperty(CourseLoyoutIDProperty, data.CourseLoyoutID);
                LoadProperty(ResignMoneyProperty, data.ResignMoney);
                LoadProperty(TotalMoneyProperty, data.TotalMoney);
                LoadProperty(PaymentIdProperty, data.PaymentId);
                LoadProperty(StateIDProperty, data.StateID);
                LoadProperty(ProductPackIDProperty, data.ProductPackID);
                LoadProperty(IsPerformanceProperty, data.IsPerformance);
                LoadProperty(ExplainProperty, data.Explain);
                LoadProperty(AddUserProperty, data.AddUser);
                LoadProperty(AddTimeProperty, data.AddTime);
                LoadProperty(IsHistoryProperty, data.IsHistory);
                LoadProperty(EXP1Property, data.EXP1);
                LoadProperty(EXP2Property, data.EXP2);
                LoadProperty(EXP3Property, data.EXP3);
                LoadProperty(EXP4Property, data.EXP4);

                LoadProperty(ProduectListProperty, data.ProduectList);
                LoadProperty(NewProduectListProperty, data.NewProduectList);
                LoadProperty(CustomerZjListProperty, data.CustomerZjList);
                LoadProperty(CustomerServerListProperty, data.CustomerServerList);
                   
                LoadProperty(TeacherIdProperty, data.TeacherId);
                LoadProperty(TeacherTimeProperty, data.TeacherTime);
                LoadProperty(TeacherAddressProperty, data.TeacherAddress);
                LoadProperty(TeacherTypeProperty, data.TeacherType);

                LoadProperty(LinkManIdProperty, data.LinkManId);
                LoadProperty(LinkManNameProperty, data.LinkManName);
                LoadProperty(LinkManSexProperty, data.LinkManSex);
                LoadProperty(LinkManPositionProperty, data.LinkManPosition);
                LoadProperty(LinkManTelProperty, data.LinkManTel);

                LoadProperty(ZhuYueRenIDProperty, data.ZhuYueRenID);

                LoadProperty(WorkFlowIdProperty, data.WorkFlowId);
                LoadProperty(WorkFlowInsIdProperty, data.WorkFlowInsId);
                LoadProperty(WorkTaskIdProperty, data.WorkTaskId);
                LoadProperty(WorkTaskInsIdProperty, data.WorkTaskInsId);
                LoadProperty(CheckUserProperty, data.CheckUser);

                LoadProperty(PresentationTypeProperty, data.PresentationType);
                LoadProperty(PresentationOrderIdProperty, data.PresentationOrderId);
                LoadProperty(PresentationReasonProperty, data.PresentationReason);
            }
        }

        [Transactional(TransactionalTypes.TransactionScope)]
        protected override void DataPortal_DeleteSelf()
        {
            //依然是调用下面的方法删除的，只是他此时可以获得自己的Id
            DataPortal_Delete(IDProperty);
        }
        #endregion

	}
}

